<html>
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<head>
<title>Section A.17.&nbsp; Chapter 17</title>
<link rel="STYLESHEET" type="text/css" href="images/style.css">
<link rel="STYLESHEET" type="text/css" href="images/docsafari.css">
<script type="text/javascript"><!--
google_ad_client = "pub-0203281046321155";
google_alternate_ad_url = "http://www.bookhtml.com/adbrite.htm";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text_image";
google_ad_channel ="4867465545";
google_color_border = "FFFFFF";
google_color_link = "0000FF";
google_color_bg = "FFFFFF";
google_color_text = "000000";
google_color_url = "0000FF";
//--></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td><div STYLE="MARGIN-LEFT: 0.15in;">
<a href=learnphpmysql-APP-A-SECT-16.html><img src="images/prev.gif" width="60" height="17" border="0" align="absmiddle" alt="Previous Page"></a>
<td align="right"><div STYLE="MARGIN-LEFT: 0.15in;">
<a href=learnphpmysql-COLOPHON.html><img src="images/next.gif" width="60" height="17" border="0" align="absmiddle" alt="Next Page"></a>
</div></td></tr></table>
<br><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><TD valign="top"><a name="learnphpmysql-APP-A-SECT-17"></a>
<h3 id="title-IDAY5DFF" class="docSection1Title">A.17. Chapter 17</h3>
<dl class="docList">
<dt><br><p><span class="docPubcolor"><span class="docEmphStrong">Solution to Question 17-1</span></span></p></dt>
<dd><p class="docList">Some PHP interpreters may not be configured to execute PHP code that starts with <tt>&lt;?</tt>. It can also cause problems with XML parsing.</p></dd>

<dt><br><p><span class="docPubcolor"><span class="docEmphStrong">Solution to Question 17-2</span></span></p></dt>
<dd><p class="docList">The <tt>//</tt> comment style comments out the current line only, while <tt>/*</tt> comments out lines until a matching <tt>/*</tt> comment is encountered.</p></dd>

<dt><br><p><span class="docPubcolor"><span class="docEmphStrong">Solution to Question 17-3</span></span></P></dt>
<dd><p class="docList">If you are using <tt>include_once()</tt> and an include file is accidentally included more than once, a function redefinition error will not occur. This can easily happen when included files contain their own include lines.</p></dd>

<dt><br><P><span class="docPubcolor"><span class="docEmphStrong">Solution to Question 17-4</span></span></P></dt>
<dd><p class="docList">The code should follow the coding conventions to make it easy to read and portable:</p>
<pre>
&lt;?php
/*
 * this file welcomes the user.
 * this file welcomes the user and uses proper code styles.
 *
 * Copyright 2006 (c) O'Reilly &amp; Associates
 *
 * @version   $Id: coding_standards_example.html,v 1.2 2006/1/19 24:49:50
 *
 */
//verify the user
if ($_GET[user_id] == 'Admin')
{
  //Welcome the admin user to the control panel.
  echo ('Welcome to the control panel.');
}
else
{
  //Welcome other user.
  echo ('Welcome.');
}
?&gt;
</pre><BR>

</dd>
</dl>

</TD></TR></table>
<br>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td><div STYLE="MARGIN-LEFT: 0.15in;">
<a href=learnphpmysql-APP-A-SECT-16.html><img src="images/prev.gif" width="60" height="17" border="0" align="absmiddle" alt="Previous Page"></a>
<td align="right"><div STYLE="MARGIN-LEFT: 0.15in;">
<a href=learnphpmysql-COLOPHON.html><img src="images/next.gif" width="60" height="17" border="0" align="absmiddle" alt="Next Page"></a>
</div></td></tr></table>
</body></html>
